<<<<<<< HEAD
<!--分类页  -->
<template>
  <div class="category">
    <!-- 搜索栏 -->
    <van-search shape="round" v-model="value" placeholder="请输入搜索关键词" />
    <div class="bottom">
      <div class="left">
        <van-sidebar v-model="activeKey" @change="onChange">
          <van-sidebar-item
            v-for="item in categoryList"
            :key="item.id"
            :title="item.name"
          />
        </van-sidebar>
      </div>
      <div class="right">
        <img :src="currentImg" alt="" />
        <h4>{{ name }}</h4>
        <van-grid :column-num="3">
          <van-grid-item
            v-for="item in subCategoryList"
            :key="item.id"
            :icon="item.wap_banner_url"
            :text="item.name"
          />
        </van-grid>
      </div>
    </div>
=======
<template>
  <div>
    <h2>分类</h2>
>>>>>>> d6dca7df47a4705c87da89a691b1a266860fdc30
  </div>
</template>

<script>
<<<<<<< HEAD
// 导入分类页
import { ClassifyList } from "@/https/http";
import { ClassifycurrentList } from "@/https/http";
export default {
  data() {
    return {
      value: "", // 搜索关键字
      activeKey: 0, // 默认左侧栏下标
      categoryList: [], // 左侧栏导航数组
      subCategoryList: [], // 右下方渲染的子数据
      currentImg: "",
      name: "",
    };
  },
  created() {
    ClassifyList().then((res) => {
      // console.log(this);
      this.categoryList = res.data.categoryList;
      this.subCategoryList = res.data.currentCategory.subCategoryList;
      this.name = res.data.currentCategory.name;
      this.currentImg = res.data.currentCategory.banner_url;
    });
  },
  methods: {
    onChange(index) {
      this.activeKey = index;
      let id = this.categoryList[index].id;
      // console.log(id);
      // console.log(index);
      ClassifycurrentList({ id: id }).then((res) => {
        console.log(res);
        this.name = res.data.currentCategory.name;
        this.currentImg = res.data.currentCategory.banner_url;
        this.subCategoryList = res.data.currentCategory.subCategoryList;
      });
    },
  },
};
</script>
<style lang='less' scoped>
/* @import url(); 引入css类 */
.category {
  .bottom {
    display: flex;
    .right > img {
      width: 100%;
    }
    h4 {
      text-align: center;
    }
  }
}
=======
export default {

}
</script>

<style>

>>>>>>> d6dca7df47a4705c87da89a691b1a266860fdc30
</style>